package com.springBoot.springBootSysCore.common.third.sms;

import com.springBoot.springBootSysCore.common.utils.http.HttpRequest;

/**
 * 美圣短信
 * @author Administrator
 *
 */
public class MeiSheng {

	/**
	 * 需要修改
	 */
	private static final String ACCOUNT = "JSM41820";
	private static final String PASSWORD = "4bnkqrcm";
	private static final String KEY = "y66brxc598i3";
	

	public static void main(String[] args) {
		try {
			sendSMS("13551883869","888888");
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	/**
	 * 发送短信
	 * @return 
	 * @throws Exception
	 */
	public static String sendSMS(String phones,String content)throws Exception {
		String url = "http://112.74.76.186:8030/service/httpService/httpInterface.do?";
		String param = "method=sendUtf8Msg&username="+ACCOUNT+"&password="+PASSWORD+"&veryCode="+KEY+"&mobile="+phones+"&content=@1@="+content+"&msgtype=2&tempid=JSM41820-0002";
		
		String resultStr = HttpRequest.sendPost(url, param);
		if(resultStr.contains("<status>0</status>")){
			return "success";
		}
		return "error";
	}
	
}
